#ifndef CALLCONTROLPANEL_H
#define CALLCONTROLPANEL_H

#include <QWidget>
#include <QHash>
#include <QTimer>
#include "../remoteservice/baseresp.h"
#include "../remoteservice/statinfo.h"
#include "../remoteservice/configinfo.h"
#include "../remoteservice/camerainfo.h"
#include "../remoteservice/micinfo.h"

namespace Ui {
class CallControlPanel;
}

class CallControlPanel : public QWidget
{
    Q_OBJECT
    
public:
    explicit CallControlPanel(QWidget *parent = 0);
    ~CallControlPanel();

    void resetStatus();

    void setSoundStatus(bool s);
    void setShowLocalStatus(bool s);
    void setVedioStatus(bool s);
    void setDocStatus(bool s);

    void setFirstFocus();

    QList<QList<QString> > statList() const;
    void setStatList(const QList<QList<QString> > &statList);

    void changeLocalShow();
    void changeSound();
    void changeVedio();
    void changeDoc();
    void showConnInfo();
    void closeConnectInfo();

protected:
    bool eventFilter(QObject *o, QEvent *e);
    void hideEvent(QHideEvent *);
    void initFocusOrder();

private slots:
    void aquireFocus();
    void changeLocalShowSlot(BaseResp);
    void changeSoundSlot(BaseResp);
    void changeVedioSlot(BaseResp);
    void changeDocSlot(BaseResp);
    void showConnInfoSlot(StatInfo);
    void configSlot(ConfigInfo);
    void micStatusSlot(MicInfo);
    void cameraStatusSlot(CameraInfo);
    void updateConnectInfo();    
    void updateCellNameSlot(QString data);
    
private:
    Ui::CallControlPanel *ui;
    bool m_showlocal;
    bool m_doc;
    bool m_localvedio;
    bool m_sound;
    bool m_info;
    bool m_mode;
    bool m_remotevedio;
    QHash<QObject*, QList<QObject*> > m_ctrlOrder;
    QObject* m_currentWidget;
    QList<QList<QString> > m_statList;
    QTimer m_timer;
};

#endif // CALLCONTROLPANEL_H
